TILESET ORGANIZING

example: BG Layer 1 of grasslands areas (Mario's Pad, Mushroom Way)

A. organize 16x16 tiles from decompressed data

  1. DECOMPRESS TILESET

    example: Grasslands BG Layer 1





    decompressed tileset:






  2. ORGANIZE 16x16 tile

    example: tile 0x03






B. define graphic and palette of tiles

  1. LOAD GRAPHIC SETS





    $0E60EA
    graphics set 0x40
    $0E7E77
    graphics set 0x41
    $0E8C8E
    graphics set 0x42
    $0E994B
    graphics set 0x43
    $0EA5CB
    graphics set 0x44


  2. DEFINE GRAPHIC SET OF 8x8 TILE

    here is the decompressed data for the Mario's Pad tileset:



    example: 51 2D


    The section (graphic set) is determined through the remainder after AND'ing the byte with 0x1F then dividing it by 4.

    example: the remainder of 0x2D AND'ed with 0x1F then divided by 4 is 1, therefore the tile is from section 1 (graphic set 0x41)

    Thus, the tile is number 0x51 of graphic set 0x41:


  3. DEFINE PALETTE OF 8x8 TILE

    The palette of an 8x8 tile is assigned from the area's palette set.
    This is the Grasslands palette set, which is assigned to Mario's Pad:

    These are referred to as palettes 0 - 7.

    The palette is determined through the quotient after AND'ing the byte with 0x1F then dividing it by 4.

    example: the quotient of 0x2D AND'ed with 0x1F then divided by 4 is 3, therefore it uses palette 3


    is after applying the palette

  4. MIRRORING AND INVERTING


    The 8x8 tile 51 2D is neither mirrored or inverted. To mirror it, change 0x2D to 0x6D. To invert it, change 0x2D to 0xA2. To mirror and invert it, change 0x2D to 0xED.